package yh;

/**
 * 数组定义，以及动态初始化
 */
public class ArrayDemo1 {
    public static void main(String[] args) {
        //定义数组
        int[] arr1;
        //数组初始化
        arr1=new int[4];
        arr1[0]=10;
        arr1[1]=20;
        arr1[2]=30;
        arr1[3]=40;
        //取值
        System.out.println(arr1[0]);
        System.out.println(arr1[1]);
        System.out.println(arr1[2]);
        System.out.println(arr1[3]);
    }
}
